<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
<title>Insert title here</title>
</head>
<body>
<table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
         <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
        $(function() {
            $("#gridlist").jqGrid(
                    {   url : "${ctx}/test/getGridBaseDataList.html",
                        mtype : "POST",
                        datatype : "json",
                        autowidth : true,
                        height : 255,
                        colNames : [ '登录名','用户名','类型 '],
                        colModel : [
                                    {name : 'username',index : 'username',hidden : false , width : 100,align : "center"},
                                    {name : 'name',index : 'name',width : 120,align : "center",sortable:false},  
                                    {name : 'type',index : 'type',width : 160,align : "center",
                                        formatter:function(val, opts,rowdata) {
                                            return val;
                                        }
                                    }
                        ],
                        rowNum : 0,
                        //rowList : [ 10, 20, 50,100],
                        rownumbers : true,
                        //pager : "#gridpage",
                        //multiselect: true, 
                        viewrecords : true,
                        caption : "用户",
                        jsonReader : {
                            repeatitems : false,
                            id : "ids"
                        }
                    });
            $("#gridlist").jqGrid('navGrid', '#gridpage', {add : false,edit : false,del : false,search : false,refresh : false});
            $(window).trigger("resize");
        });
               function getFoucs(obj, rowId) {
                   var text = $.trim($(obj).val());
                   if (text != null && text != "") {
                       var $checkbox = $("#jqg_gridlist_" + rowId);
                       if ($checkbox.is(":not(:checked)")) {
                           $("#gridlist").setSelection(rowId);
                       }
                   }
               }
               
               //查询
               function gridSerch() {
                   var orgCode = $.trim($("#orgCode").val());
                   var orgName = $.trim($("#orgName").val());
                   $("#gridlist").jqGrid('setGridParam',{  
                       datatype:'json',
                       postData:{
                           "orgCode":orgCode,
                           "orgName":orgName
                       },
                       page:1
                   }).trigger("reloadGrid"); //重新载入  
               }
               
                    
    </script>
</body>
</html>